<template>
    <div v-if="showDialog"
        class="fixed inset-0 flex items-center justify-center w-full  h-full bg-black bg-opacity-50 z-50">
        <div class="bg-white p-8 rounded shadow-lg">
            <p class="mb-4">{{ props.message }}</p>
            <div style="text-align: center;">
                勿关闭.请稍后....
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import { ref } from "vue";

const props = defineProps<{
    message: string;
}>();

const emit = defineEmits<{
    (event: "confirm"): void;
    (event: "cancel"): void;
}>();

const showDialog = ref(false);

const confirm = () => {
    emit("confirm");
    showDialog.value = false;
};

const cancelFun = () => {
    emit("cancel");
    showDialog.value = false;
};

const open = () => {
    showDialog.value = true;
};
defineExpose({
    open,
    cancelFun,
});
</script>
